home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / BasicPasswordFieldUI.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  85 lines

  1. /*
  2.  * @(#)BasicPasswordFieldUI.java    1.21 98/04/09
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20. package com.sun.java.swing.plaf.basic;
  21.  
  22. import java.awt.*;
  23. import com.sun.java.swing.*;
  24. import com.sun.java.swing.text.*;
  25. import com.sun.java.swing.event.*;
  26. import com.sun.java.swing.plaf.*;
  27.  
  28.  
  29. /**
  30.  * Provides the Windows look and feel for a password field.
  31.  * The only difference from the standard text field is that
  32.  * the view of the text is simply a string of the echo 
  33.  * character as specified in JPasswordField, rather than the 
  34.  * real text contained in the field.
  35.  * <p>
  36.  * Warning: serialized objects of this class will not be compatible with
  37.  * future swing releases.  The current serialization support is appropriate
  38.  * for short term storage or RMI between Swing1.0 applications.  It will
  39.  * not be possible to load serialized Swing1.0 objects with future releases
  40.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  41.  * baseline for the serialized form of Swing objects.
  42.  *
  43.  * @author  Timothy Prinzing
  44.  * @version 1.21 04/09/98
  45.  */
  46. public class BasicPasswordFieldUI extends BasicTextFieldUI {
  47.  
  48.     /**
  49.      * Creates a UI for a JPasswordField.
  50.      *
  51.      * @param c the JPasswordField
  52.      * @return the UI
  53.      */
  54.     public static ComponentUI createUI(JComponent c) {
  55.         return new BasicPasswordFieldUI();
  56.     }
  57.  
  58.     /**
  59.      * Fetches the name used as a key to look up properties through the
  60.      * UIManager.  This is used as a prefix to all the standard
  61.      * text properties.
  62.      *
  63.      * @return the name ("PasswordField")
  64.      */
  65.     protected String getPropertyPrefix() {
  66.     return "PasswordField";
  67.     }
  68.  
  69.     /**
  70.      * Creates a view (PasswordView) for an element.
  71.      *
  72.      * @param elem the element
  73.      * @return the view
  74.      */
  75.     public View create(Element elem) {
  76.     return new PasswordView(elem);
  77.     }
  78.  
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85.